<template>
	<!--浮框-->
    <div class="zst-box-flex-box1" v-if='isShow == 0?false:true && isShow'>
      <!-- <span @click='isShow = !isShow;'>x</span> -->
      <a :href="AdUrl" class="goBaiduAd"><img :src="AdImg"></a>
    </div>
</template>

<script>
import {getAdvertiSense} from '@/api/whole';
export default {
  name: "advert",
  props: ["gid"],
  data() {
    return { 
    	isShow:false,
    	isShow:true,
   		AdImg:'',
	    AdUrl:'',
	    qgcGid:{
	    	'52':{
	    		name:'排列五',
	    		adUrl:'pl5_active',
	    		imgUrl:'52.png'
	    	},
	    	'53':{
	    		name:'排列三',
	    		adUrl:'pl3_active',
	    		imgUrl:'53.png'
	    	},
	    	'50':{
	    		name:'超级大乐透',
	    		adUrl:'dlt_active',
	    		imgUrl:'50.png'
	    	},
	    	'51':{
	    		name:'七星彩',
	    		adUrl:'qxc_active',
	    		imgUrl:'51.png'
	    	},
	    	'07':{
	    		name:'七乐彩',
	    		adUrl:'qlc_active',
	    		imgUrl:'07.png'
	    	},
	    	'03':{
	    		name:'福彩3D',
	    		adUrl:'3d_active',
	    		imgUrl:'03.png'
	    	},
	    	'01':{
	    		name:'双色球',
	    		adUrl:'ssq_active',
	    		imgUrl:'01.png'
	    	},
	    },
	};
  },
  methods:{
  	getAdvertiSenseFun(){
      	getAdvertiSense({
      		cfrom: "h5",
    		position:this.gid
      	}).then(res=>{
           this.isShow = res.data.isShow;
        })
	},
  },
  created() {
	this.getAdvertiSenseFun();
	if (this.lottery[this.gid].type == 0 && this.qgcGid[this.gid]) { //全国彩
		this.AdImg = require('../assets/zst/'+this.qgcGid[this.gid].imgUrl);
		this.AdUrl = 'http://h.5106cai.com/'+this.qgcGid[this.gid].adUrl+'/?cf=zs#/'
	}else if(this.lottery[this.gid].type == 1){ //地方彩
		this.AdImg = require('../assets/zst/288.png');
		this.AdUrl = 'http://h.5106cai.com/regit_active/?cf=zs1#/'
	}else{ //高频彩
		this.AdImg = require('../assets/zst/288.png');
		this.AdUrl = 'http://h.5106cai.com/regit_active/?cf=zs2#/'
	}
  },
  mounted() {

  }
};
</script>

<style lang="less" scoped>
.zst-box-flex-box1{
		position: fixed;
		width: 75px;
		height: 81px;
		bottom: 30%;
		// top: 70px;
		right:15px;
		z-index: 9999;
		span{
			position:absolute;
			width: 20px;
			height: 20px;
			line-height: 20px;
			font-size: 18px;
			text-align: center;
			color: #000;
			top: -30px;
			right: -10px;
			background:rgba(255,255,255);
			border-radius: 50%;
		}
		img{
			width: auto;
			height:78px;
		}
	}
</style>

